<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style type="text/css">
			.a1{
				background-image: url(../../资料/字符串操作方法.png);
			}
			.a2{
				background-image: url(../../../项目/移动端/img/banner.png);
			}
		</style>
	</head>
	<body id="body1" class="a1">
		<button type="button">按钮1</button>
		<button type="button">按钮2</button>
	</body>
	<script type="text/javascript">
		var btn = document.querySelectorAll("body button");
		btn.forEach(function(item,index){
			item.onmouseover = function(){
				body1.className = "";
				document.body.className =`a${1+index}`; 
			}
		})
	</script>
</html>
